package com.example.androidlogin;

import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import java.util.List;

public class Fragment1 extends Fragment {
    private RecyclerView mRecyclerView;
    private List<Integer> list_iv;
    private List<String> list_tv1;
    private List<String> list_tv2;
    private List<String> list_tv3;

    public Fragment1(List<Integer> list_iv, List<String> list_tv1, List<String> list_tv2, List<String> list_tv3) {
        this.list_iv = list_iv;
        this.list_tv1 = list_tv1;
        this.list_tv2 = list_tv2;
        this.list_tv3 = list_tv3;
    }


    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        mRecyclerView.setLayoutManager(new LinearLayoutManager(mRecyclerView.getContext()));
        mRecyclerView.setAdapter(new RecyclerViewAdapter(list_iv,list_tv1,list_tv2,list_tv3,mRecyclerView.getContext()));
    }

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        mRecyclerView= (RecyclerView) inflater.inflate(R.layout.fragment1,container,false);
        return mRecyclerView;
    }
}
